package app.base.systemmanage.systempermsmanage.dao;

import app.base.systemmanage.systempermsmanage.model.SysPermissions;
import app.base.systemmanage.systempermsmanage.model.SysPermissionsExample;
import app.base.systemmanage.systempermsmanage.model.SysPermissionsKey;

import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ibatis.sqlmap.client.SqlMapClient;

public class SysPermissionsDAOImpl extends SqlMapClientDaoSupport implements SysPermissionsDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public SysPermissionsDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public int countByExample(SysPermissionsExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("SYS_PERMISSIONS.ibatorgenerated_countByExample", example);
        return count.intValue();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public int deleteByExample(SysPermissionsExample example) {
        int rows = getSqlMapClientTemplate().delete("SYS_PERMISSIONS.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public int deleteByPrimaryKey(SysPermissionsKey key) {
        int rows = getSqlMapClientTemplate().delete("SYS_PERMISSIONS.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public void insert(SysPermissions record) {
        getSqlMapClientTemplate().insert("SYS_PERMISSIONS.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public void insertSelective(SysPermissions record) {
        getSqlMapClientTemplate().insert("SYS_PERMISSIONS.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public List selectByExample(SysPermissionsExample example) {
        List list = getSqlMapClientTemplate().queryForList("SYS_PERMISSIONS.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public SysPermissions selectByPrimaryKey(SysPermissionsKey key) {
        SysPermissions record = (SysPermissions) getSqlMapClientTemplate().queryForObject("SYS_PERMISSIONS.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public int updateByExampleSelective(SysPermissions record, SysPermissionsExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("SYS_PERMISSIONS.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public int updateByExample(SysPermissions record, SysPermissionsExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("SYS_PERMISSIONS.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public int updateByPrimaryKeySelective(SysPermissions record) {
        int rows = getSqlMapClientTemplate().update("SYS_PERMISSIONS.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    public int updateByPrimaryKey(SysPermissions record) {
        int rows = getSqlMapClientTemplate().update("SYS_PERMISSIONS.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table SYS_PERMISSIONS
     *
     * @ibatorgenerated Wed Jul 08 18:02:18 CST 2009
     */
    private static class UpdateByExampleParms extends SysPermissionsExample {
        private Object record;

        public UpdateByExampleParms(Object record, SysPermissionsExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
    
    //
    public SqlMapClient getMySqlMapClient(){
        return getSqlMapClientTemplate().getSqlMapClient();
    }
    
    public void insert_0001(SysPermissions record) {
        getSqlMapClientTemplate().insert("SYS_PERMISSIONS.insert_0001", record);
    }
    
    public int update_0001(SysPermissions record) {
        int rows = getSqlMapClientTemplate().update("SYS_PERMISSIONS.update_0001", record);
        return rows;
    }
    
    public int delete_0001(SysPermissionsKey key) {
        int rows = getSqlMapClientTemplate().delete("SYS_PERMISSIONS.delete_0001", key);
        return rows;
    }
    
    @SuppressWarnings("unchecked")
	public List<SysPermissions> select_0001(Map<String, Object> map) {
        List<SysPermissions> list = getSqlMapClientTemplate().queryForList("SYS_PERMISSIONS.select_0001", map);
        return list;
    }
    
    public int count_0001(Map<String, Object> map) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("SYS_PERMISSIONS.count_0001", map);
        return count.intValue();    	
    }

    @SuppressWarnings("unchecked")
	public List<SysPermissions> select_0002(java.util.Map<String, Object> map) {
        List<SysPermissions> list = getSqlMapClientTemplate().queryForList("SYS_PERMISSIONS.select_0002", map);
        return list;
    }
    
    @SuppressWarnings("unchecked")
	public List select_0003(Map<String, Object> map) {
        List list = getSqlMapClientTemplate().queryForList("SYS_PERMISSIONS.select_0003", map);
        return list;
    }  
 }